package com.ebt.m.policy.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;

import com.ebt.m.R;
import com.ebt.m.commons.buscomponent.listview.IView;


/**
 * @author Damon.Han
 */
public class SearchContentMore extends IView {

    TextView nameView;
    private View mainView;

    public SearchContentMore(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mainView = inflate(context, R.layout.layout_view_content_more, this);
        nameView = (TextView) mainView.findViewById(R.id.txt);

    }

    public SearchContentMore(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public SearchContentMore(Context context) {
        this(context, null);
    }

    @Override
    public void update(Object... args) {
        String title = (String) args[0];
        nameView.setText(title);
        mainView.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                if (mOnclickListner != null) {
                    mOnclickListner.onClick(view, title);
                }
            }
        });
    }

}
